package com.ccc.demoboot.controller;

import com.ccc.demoboot.common.R;
import com.ccc.demoboot.pojo.Post;
import com.ccc.demoboot.service.PostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author wz
 * @Date 2024/7/10 8:34
 * @PackageName:com.ccc.demoboot.controller
 * @ClassName: PostController
 */
@RequestMapping("post")
@RestController
public class PostController {


    @Autowired
    PostService postService;

    /**
     * 查询所有岗位信息
     * @return
     */
    @PostMapping("/select")
    public R select(){
        List<Post> list = this.postService.list();
        return new R().add("list",list);
    }



    @PostMapping("/depselect")
    public R depSelect(@RequestBody Post post){
        List<Post> list=this.postService.depSelect(post.getDepartmentid());
        return new R().add("list",list);
    }
}
